GPIOD user guide

Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.


Common commands for inspecting and controlling GPIO using gpiod tools on Quectel Pi. The currently connected development board has been verified with libgpiod v1.6.3.

Installation and Verification

sudo apt update
sudo apt install -y gpiod
gpiodetect --version
gpiodetect
gpioinfo

Command

Purpose

gpiodetect

View GPIO controllers

gpioinfo

View GPIO line status and usage

gpioget

Read input state

gpioset

Set output state

gpiomon

Monitor edge events

Controller Identification

Example output from the current development board is shown below. For actual projects, refer to the output from the board in use.

gpiochip0 [400000.pinctrl] (114 lines)
gpiochip1 [1c40000.qcom,spmi:qcom,pm6125@0] (9 lines)
gpiochip2 [soc:spf_core_platform:lpi_pinct] (19 lines)

Common Commands

# View lines on the primary controller
gpioinfo /dev/gpiochip0

# Read line 36 of gpiochip0
gpioget gpiochip0 36

# Set output high and hold for 5 seconds
gpioset --mode=time --sec=5 gpiochip0 36=1

# Monitor rising-edge events
gpiomon --rising-edge gpiochip0 36

Version Differences

Function

Current v1 Syntax

Syntax That May Appear in Newer Documentation

Read

gpioget gpiochip0 36

gpioget -c gpiochip0 36

Hold Output

gpioset --mode=time --sec=5 gpiochip0 36=1

gpioset -c gpiochip0 -p 5s 36=1

Rising-edge Monitoring

gpiomon --rising-edge gpiochip0 36

gpiomon -c gpiochip0 -e rising 36

Notes

  • GPIO line offset is not the same as the physical header pin number.

  • Lines marked [used] or already having a consumer should not be controlled directly.

  • After the gpioset process exits, the output state may revert to the default. Do not rely on the residual level after the process exits.